<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			
			document.write(document.cookie);
			
			if(document.cookie.length>0){
				//用户第二次访问 直接显示欢迎光临，xxxx
				var info = document.cookie;
				console.log(info);
				var name = info.substr(info.indexOf("=")+1);
				document.write("欢迎光临，"+name);
				
				
			}else{
			//用户第一次访问 询问用户名字叫什么，保存起来
			//1.
			var name = window.prompt("您好,请输入您的名字")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
			}
			
			
			
			
			
			
			
			
			
			
			
		</script>
		
		<div id="input1">
			
		</div>
	</body>
</html>
